package demo03方法的重载;

public class Demo04 {
    public static void main(String[] args) {
        double max =max(10.0, 10.0);
        System.out.println(max);
    }

    //比大小
    public static int max(int num1,int num2){

        int result = -1;
        if (num1 > num2){
            result = num1;
        }else if (num2 > num1){
            result = num2;
        }else {
            System.out.println("num1 == num2");
            return 0;//中止方法
        }
        return  result;
    }
    public static double max(double num1, double num2){

        double result = -1.0;
        if (num1 > num2){
            result = num1;
        }else if (num2 > num1){
            result = num2;
        }else {
            System.out.println("num1 == num2");
            return 0.0;//中止方法
        }
        return  result;
    }
}
